<?php 

define('AREA', 'C');

if( function_exists("date_default_timezone_set") and function_exists("date_default_timezone_get") )
	@date_default_timezone_set(@date_default_timezone_get());

//Application mode
define('ENVIROMENTS', 'production');
//define('ENVIROMENTS', 'development');
$app_debuger = false;
if ( ENVIROMENTS == 'development' ) {
	//trace level
	defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',0);
	$app_debuger = true;
}
defined('YII_DEBUG') or define('YII_DEBUG', $app_debuger);
//show profiler
defined('YII_DEBUG_SHOW_PROFILER') or define('YII_DEBUG_SHOW_PROFILER', $app_debuger);
//enable profiling
defined('YII_DEBUG_PROFILING') or define('YII_DEBUG_PROFILING', $app_debuger);
//Error reporting here
error_reporting(~E_STRICT); //Remove error
//Load files
// change the following paths if necessary
$globals=dirname(__FILE__).'/common/globals.php';
$yii=dirname(__FILE__).'/framework/yii.php';
$config=dirname(__FILE__).'/customer/config/main.php';

require_once($globals);
require_once($yii);
//Kiem tra co phai Agent la Mobile
require_once(dirname(__FILE__) . "/common/extensions/Mobile/MobileDetect.php");
$detect = new Mobile_Detect();
defined('IS_MOBILE') or define('IS_MOBILE', $detect->isMobile());
defined('IS_TABLET') or define('IS_TABLET', $detect->isTablet());
//Manage application
$app = Yii::createWebApplication($config);
$app->setGlobalState('Yii.CSecurityManager.validationkey', '710e7d401279a17e76bf3b7e670ffc11');
$app->run();
if(defined('YII_DEBUG_DISPLAY_TIME') && YII_DEBUG_DISPLAY_TIME)
	echo Yii::getLogger()->getExecutionTime();